***Table 3: Hybrid Random-Effects Model Resuls for Total News Coverage
*Without ideology
xtset group_id iyear

xtreg news_total ///
terror_gpm govtarg_gpm suicide_gpm hostage_gpm nattacks_gpm nvictims_gpm us_gpm uk_gpm ///
terror_gpmc govtarg_gpmc suicide_gpmc hostage_gpmc nattacks_gpmc nvictims_gpmc us_gpmc uk_gpmc ///
iyear, mle nolog
est store mle1

*With ideology
xtset group_id iyear

xtreg news_total ///
terror_gpm govtarg_gpm suicide_gpm hostage_gpm nattacks_gpm nvictims_gpm us_gpm uk_gpm ///
terror_gpmc govtarg_gpmc suicide_gpmc hostage_gpmc nattacks_gpmc nvictims_gpmc us_gpmc uk_gpmc ///
nat rel right ///
iyear, mle nolog
est store mle2
estout mle1 mle2,cells(b(star fmt(3)) se(par fmt(3))) 


***Table 4: Hybrid Random-Effects Model Results by News Outlet
*NYTimes
xtset group_id iyear

xtreg nytimes ///
nytimes_terror_gpm govtarg_gpm suicide_gpm hostage_gpm nattacks_gpm nvictims_gpm us_gpm uk_gpm ///
nytimes_terror_gpmc govtarg_gpmc suicide_gpmc hostage_gpmc nattacks_gpmc nvictims_gpmc us_gpmc uk_gpmc ///
nat rel right ///
iyear, mle nolog
est store mle3

*TOL
xtset group_id iyear

xtreg times ///
times_terror_gpm govtarg_gpm suicide_gpm hostage_gpm nattacks_gpm nvictims_gpm us_gpm uk_gpm ///
times_terror_gpmc govtarg_gpmc suicide_gpmc hostage_gpmc nattacks_gpmc nvictims_gpmc us_gpmc uk_gpmc ///
nat rel right ///
iyear, mle nolog
est store mle4


*AP
xtset group_id iyear

xtreg ap ///
ap_terror_gpm govtarg_gpm suicide_gpm hostage_gpm nattacks_gpm nvictims_gpm us_gpm uk_gpm ///
ap_terror_gpmc govtarg_gpmc suicide_gpmc hostage_gpmc nattacks_gpmc nvictims_gpmc us_gpmc uk_gpmc ///
nat rel right ///
iyear, mle nolog
est store mle5
estout mle3 mle4 mle5,cells(b(star fmt(3)) se(par fmt(3))) 


****Margins Plots for Interactions Over Time ***

*Maximum liklihood model with interactions for margins plots

xtreg news_total ///
terror_gpm govtarg_gpm suicide_gpm hostage_gpm nattacks_gpm nvictims_gpm us_gpm uk_gpm ///
terror_gpmc govtarg_gpmc suicide_gpmc hostage_gpmc nattacks_gpmc nvictims_gpmc us_gpmc uk_gpmc ///
i.nat i.right i.rel ///
c.iyear c.iyear#c.suicide_gpm c.iyear#c.hostage_gpm c.iyear#c.uk_gpm c.iyear#c.us_gpm c.iyear#i.right  c.iyear#i.rel  c.iyear#i.nat, mle nolog
est store mle6

*Figure 10
quiet: margins, dydx(c.suicide_gpm) at(c.iyear=(1970(1)2013)) atmeans
marginsplot, yline(0)

*Margins Hostages
quiet: margins, dydx(c.hostage_gpm) at(c.iyear=(1970(1)2013)) atmeans
marginsplot, yline(0)

*Margins UK
quiet: margins, dydx(c.uk_gpm) at(c.iyear=(1970(1)2013)) atmeans
marginsplot, yline(0)

*Margins US
quiet: margins, dydx(c.us_gpm) at(c.iyear=(1970(1)2013)) atmeans
marginsplot, yline(0)

*Margins Right
quiet: margins, dydx(i.right) at(c.iyear=(1970(1)2013)) atmeans
marginsplot, yline(0)

*Margins Nat
quiet: margins, dydx(i.nat) at(c.iyear=(1970(1)2013)) atmeans
marginsplot, yline(0)

*Margins Rel
quiet: margins, dydx(i.rel) at(c.iyear=(1970(1)2013)) atmeans
marginsplot, yline(0)
